import request from '@/common/js/request.js'

const mf_MyTaskDoneApi = {
  list: '/flow/endBusinessList',
  save: '/mf_MyTaskDone/save',
  view: '/flow/queryComment',
  del: '/mf_MyTaskDone/delete',
  dels: '/mf_MyTaskDone/batchDel',
  output: '/mf_MyTaskDone/output',
  mypendingBusinessCount: 'flow/mypendingBusinessCount',
  findProcessStart: 'flow/findProcessStart'
}

/**
 *  根据未完成计算判断流程状态
 */
export function findProcessStart(params) {
  return request({
    url: mf_MyTaskDoneApi.findProcessStart,
    method: 'post',
    params: params
  })
}

/**
 *  获取我要处理的任务数
 */
export function mypendingBusinessCount(params) {
  return request({
    url: mf_MyTaskDoneApi.mypendingBusinessCount,
    method: 'post',
    params: params
  })
}

/**
 * 导出已处理业务
 */
export function output(data) {
  return request({
    url: mf_MyTaskDoneApi.output,
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
/**
 * 批量删除已处理业务
 * @param {*} parameter
 */
export function delMf_MyTaskDones(ids) {
  return request({
    url: mf_MyTaskDoneApi.dels + '/' + ids,
    method: 'post'
  })
}
/**
 * 删除已处理业务
 * @param {*} id
 */
export function delMf_MyTaskDone(id) {
  return request({
    url: mf_MyTaskDoneApi.del + '/' + id,
    method: 'post'
  })
}
/**
 * 查看、编辑已处理业务
 * @param {*} id
 */
export function viewMf_MyTaskDone(params) {
  return request({
    url: mf_MyTaskDoneApi.view,
    method: 'post',
    params: params
  })
}
/**
 * 保存已处理业务
 * @param {*} parameter
 */
export function saveMf_MyTaskDone(parameter) {
  return request({
    url: mf_MyTaskDoneApi.save,
    method: 'post',
    data: parameter
  })
}
/**
 * 查询已处理业务列表
 * @param {*} parameter
 */
export function queryMf_MyTaskDoneList(userid, queryParam) {
  return request({
    url: mf_MyTaskDoneApi.list,
    method: 'post',
    params: { userid },
    data: queryParam
  })
}

/**
	* 查询子流程已办列表
	*
	* @param userid
	* @param pageinfo
	* @return
*/
export function detailsBusinessHistoryList(parameter, data){
	return request({
		url: 'flow/detailsBusinessHistoryList',
		method: 'post',
		params: parameter,
		data: data
	})
}

